home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1994 / MacHack 1994.toast / MacHack™94 / Talks & Papers / Timothy Knox / yerk 3.66 / Supplement / Unsupported / Optionals / needAdisk < prev    next >
Text File  |  1994-06-24  |  767b  |  40 lines

  1. \ If you distribute your application on more than one disk and the program
  2. \ needs a volume which is not online, call needAdisk to decide the best choice
  3. \ disk to eject to allow for the needed volume.
  4. \  9/31/86  cdn Version 1
  5.  
  6. \ ( -- addr )
  7. : defVCB $ 352 -base @ -base ;
  8.  
  9. 0 variable DrvrRec 46 allot
  10.  
  11. \ ( drv# -- fCode )
  12. : DriveStatus
  13.     DrvrRec 50 erase
  14.     8 DrvrRec 26 + w!
  15.     -5 DrvrRec 24 + w!
  16.     DrvrRec 22 + w!
  17.     DrvrRec fcall PBStatus
  18. ;
  19.  
  20. \ ( drv# -- fCode )
  21. : DiskEject
  22.     DrvrRec 50 erase
  23.     7 DrvrRec 26 + w!
  24.     -5 DrvrRec 24 + w!
  25.     DrvrRec 22 + w!
  26.     DrvrRec fcall PBControl
  27. ;
  28.  
  29. \ Eject best choice disk to allow for new disk
  30. : needAdisk
  31.     defVCB 72 + w@ 1 <>
  32.     IF    1 DiskEject drop
  33.     ELSE
  34.         2 DriveStatus drop
  35.         DrvrRec 32 + c@ 1 =
  36.         IF 2 ELSE 1 THEN
  37.         DiskEject drop
  38.     THEN
  39. ;
  40.